package com.test.ayi.test.competablefuture;

import java.util.concurrent.CompletableFuture;

public class CFtest2Compose {
    public static void main(String[] args) throws InterruptedException {


        CompletableFuture<Integer> integerCompletableFuture = CompletableFuture.supplyAsync(() -> "🥬 生菜、🥩 肥牛")   // 买菜
                .thenApply(s -> "")
                .thenCompose(s -> CompletableFuture.supplyAsync(() -> 2));// 切菜


        System.out.println(integerCompletableFuture.join()); // 🥬 生菜、🥩 肥牛 + 切片 + 咕嘟咕嘟
    }
}
